import request from "@/utils/request";
import {AxiosPromise} from "axios";
import {CrawlDataForm, CrawlDataPageResult, CrawlDataQuery,} from "./types";

/**
 * 爬虫数据分页列表
 *
 * @param data
 */
export function getPage(data: CrawlDataQuery): AxiosPromise<CrawlDataPageResult> {
	return request({
		url: "/api/v1/crawl/data/page",
		method: "post",
		data: data,
	});
}

/**
 * 爬虫数据表单数据
 *
 * @param id
 */
export function getForm(id: number): AxiosPromise<CrawlDataForm> {
	return request({
		url: "/api/v1/crawl/data/" + id + "/form",
		method: "get",
	});
}
